// pages/map/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        MapContext: null,
    },
    onLoad() {
        this.data.MapContext = wx.createMapContext("leeMap", this)
    },
    onShareAppMessage(options) {
        // 默认分享配置
        return {
            title: App.globalData.onShareAppMessage.title,
            path: App.globalData.onShareAppMessage.path,
            imageUrl: App.globalData.onShareAppMessage.imageUrl,
        }
    },
    // 跳转第三方app
    pullMapApp() {
        console.log("正在准备接入第三方app导航")
        // let latitude = '43.8377'
        // let longitude = '125.296106'
        // let name = '前进西'
        // let desc = '3号线轻轨站'
        // wx.openLocation({
        //   latitude: +latitude,
        //   longitude: +longitude,
        //   name,
        //   address: desc
        // })
        // MapContext.openMapApp
        this.data.MapContext.addMarkers({
            markers: [{
                longitude: "125.296106",
                latitude: "43.8377",
            }],
            complete: com => {
                console.log(com)
                this.data.MapContext.openMapApp({
                    longitude: 125.296106,
                    latitude: 43.8377,
                    destination: "这嘎达",
                    complete: comV => {
                        console.log(comV)
                    }
                })
            }
        })


    }
})